<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
          /* 定义动画 */
          @keyframes myAnimation {
            /* 关键帧
            from {
                width: 100px;
                height: 100px;
            }
            to {
                width: 300px;
                height: 300px;
            } */
            0%{
               background: red;
            }
            25%{
                background: yellow;
            }
            50%{
                background: green;
            }
            75%{
                background: rebeccapurple;
            }
            100%{
                background: blue;
            }       
        }

        .box {
            /* 
            transition-property 应用过渡的 CSS 
            transition-duration 定义过渡效果花费的时间。默认是 0。
            transition-timing-function 规定过渡效果的时间曲线。默认是 "ease"。
            transition-delay 规定过渡效果何时开始。默认是 0。
            */
            width: 100px;
            height: 100px;
            /* background: red; */
            animation: myAnimation 2s infinite;
            /* transition: 1s;
            transition-property:all;
            transition-duration:1s;
            transition-timing-function:ease-in; */
        }
        /* .box:hover{
            width: 300px;
            height: 300px;
           
        } */
      
    </style>
</head>
<body>
    <div class="box"> </div>
</body>
</html>